﻿using Newtonsoft.Json;
using System.ComponentModel;

namespace MapleLeaf.Pay.Pay {
    public class HongshPayClientPluginConfig : HongshPayConfig, INotifyPropertyChanged {


        public virtual event PropertyChangedEventHandler PropertyChanged;


        [JsonIgnore]
        public virtual bool Editable => !IsRunning;


        public virtual bool IsRunning {
            get => _IsRunning;
            set {
                _IsRunning = value;
                PropertyChange("IsRunning");
                PropertyChange("Editable");
            }
        }


        public void PropertyChange(string property) {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(property));
        }

        public HongshPayClientPluginConfig() { }
        private bool _IsRunning;

    }
}
